// 父类
function Person(name, age, friends) {
  this.name = name
  this.age = age
  this.friends = friends
}
Person.prototype.eating = function() {
  console.log(this.name + " eating");
}
// 子类
function Student(name, age, friends, sno) {
  // 借用构造函数
  Person.call(this, name, age, friends);
  this.sno = sno;
}
// 直接将父类赋值给子类，这种方案是不正确的
Student.prototype = Person.prototype;
// study被加上了person上面了
Student.prototype.studying = function() {
  console.log(this.name + " studying");
}

var stu = new Student("yz", 18, ["kobe"], 123);
console.log(stu);
stu.eating();


